package com.woniu.service.goldcommand;

import com.woniu.outlet.elasticSearch.po.Gold;
import com.woniu.util.ApplicationContextHolder;
import lombok.Data;

import java.net.URISyntaxException;

/**
 * @description:
 * @author: my
 * @time: 2021/4/22 19:43
 */
@Data
public class GoldDetailCommand {
    private GoldDetailCommandHandler handler;
    private String type;

    public GoldDetailCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(GoldDetailCommandHandler.class);
    }

    public GoldDetailCommand(String type){
        this();
        this.type = type;
    }

    public Gold execute() throws Exception {
        return this.handler.action(this);
    }
}
